package senior.ioExer;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;

/**
 * 输入一个文件名，输出其中的byte内容。
 * @author shkstart
 * @creat 2022-04-15:01
 */
public class Exer5 {
    public static void main(String[] args) {
        FileInputStream fis = null;
        try {
            File file = new File("D:/.temp/hello.txt");
            fis = new FileInputStream(file);

            byte[] bytes = new byte[fis.available()];
            int len;
            while ((len = fis.read(bytes)) != -1) {
                for (byte b : bytes) {
                    System.out.print(b + "\t");
                }
            }
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            if(fis != null){
                try {
                    fis.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }


    }
}
